Developer Documentation

QuickTime 4 API Documentation

Wired Movies and Sprites

| Previous | Chapter Contents | Chapter Top |

Creating an HREFTrack

Like any text track, an HREFTrack can be created using a text editor and then imported using a movie import component, or it can be created programmatically.

You create an HREFTrack programmatically by creating a text track, adding the URLs as text samples, then setting the name of the track to "HREFTrack". The track name is stored in the user data atom.

The following code snippet shows how to change the name of a text track to "HREFTrack".

    // create a Pascal string `HREFTrack'
Str255  trackNameStr = " HREFTrack" // leave a space for length byte
trackNameStr[0] = strlen(trackNameStr) - 1; // add length byte
    // store it as the track name
UserDat ud = GetTrackUserData(theTrack);
OSType  dataType = FOUR_CHAR_CODE('name');

RemoveUserData(ud, dataType, 1); // remove existing name, if any
SetUserDataItem(ud, &trackNameStr[1], trackNameStr[0], dataType, 0);

 

© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top |